package com.restkeeper.store.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.restkeeper.store.dto.CreditDTO;
import com.restkeeper.store.entity.Credit;
import com.restkeeper.store.entity.CreditCompanyUser;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 挂账单位管理表 服务类
 * </p>
 */
public interface ICreditService extends IService<Credit> {

    /**
     * 分页查询挂账列表信息
     * @param pageNo
     * @param pageSize
     * @param name
     * @return
     */
    IPage<CreditDTO> queryPageByName(long pageNo, long pageSize, String name);

    /**
     * 根据id查询挂账详情
     * @param id
     * @return
     */
    CreditDTO getCreditById(String id);

    /**
     * 新增挂账
     * @param credit
     * @param companyUserList
     * @return
     */
    boolean addCredit(Credit credit, List<CreditCompanyUser> companyUserList);

    /**
     * 新增挂账
     * @param credit
     * @param companyUserList
     * @return
     */
    boolean updateCredit(Credit credit, List<CreditCompanyUser> companyUserList);

    /**
     * 挂账数据导出
     * @param creditId
     * @param start
     * @param end
     * @return
     */
    boolean export(String creditId, Date start, Date end);
}
